home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / AMOSList / AMOSLIST.0897 / 000315_amos-request@svcs1.digex.net_Sat Aug 30 15:15:48 1997.msg < prev    next >
Text File  |  1997-09-09  |  4KB  |  110 lines

  1. Received: from svcs1.digex.net (svcs1.digex.net [204.91.197.224])
  2.     by mail2.access.digex.net (8.8.5/8.8.5) with ESMTP id PAA13831
  3.     for <mcox@access.digex.net>; Sat, 30 Aug 1997 15:15:47 -0400 (EDT)
  4. Received: (from daemon@localhost)
  5.     by svcs1.digex.net (8.8.5/8.8.5) id NAA01946
  6.     for amos-out; Sat, 30 Aug 1997 13:50:59 -0400 (EDT)
  7. Received: from mail3.access.digex.net (mail3.access.digex.net [205.197.247.4])
  8.     by svcs1.digex.net (8.8.5/8.8.5) with ESMTP id NAA01943
  9.     for <amos-list@svcs1.digex.net>; Sat, 30 Aug 1997 13:50:58 -0400 (EDT)
  10. Received: from relay2.inet.tele.dk (relay2.inet.tele.dk [194.182.149.120])
  11.     by mail3.access.digex.net (8.8.5/8.8.5) with SMTP id NAA07602
  12.     for <amos-list@access.digex.net>; Sat, 30 Aug 1997 13:50:56 -0400 (EDT)
  13. Received: (qmail 11412 invoked from network); 30 Aug 1997 18:51:01 -0000
  14. Received: from post8.tele.dk (194.239.134.172)
  15.   by relay2.inet.tele.dk with SMTP; 30 Aug 1997 18:51:01 -0000
  16. Received: from post8.tele.dk ([194.239.180.55]) by post8.tele.dk
  17.           (Netscape Mail Server v2.02) with SMTP id AAA38508
  18.           for <amos-list@access.digex.net>; Sat, 30 Aug 1997 18:50:37 +0100
  19. From: Jens Vang Petersen <top_cat@post8.tele.dk>
  20. To: amos-list@access.digex.net
  21. Date: Sat, 30 Aug 1997 15:25:46 +0100
  22. Message-ID: <yam7181.2310.1750697400@post8.tele.dk>
  23. X-Mailer: YAM 1.3.4 [020] - Amiga Mailer by Marcel Beck
  24. Subject: Errors for Mr. Giark
  25. MIME-Version: 1.0
  26. Content-Type: text/plain
  27. Status: O
  28. X-Status: 
  29.  
  30. This is realy a message for Mr. Giark, but I could not da E-mail add.
  31. anywhere, anyway it might be usefull for others too..
  32.  
  33. About Error-routines..
  34. I responded to a question from Mr. Giark about problems with the
  35. error-checking functions, but since it was a long time since I'd last used
  36. 'em, then I realy screwed up. Then I made a new response, that was not quite
  37. right either, so as I am rewriting the AB3DII-Editor, I got in need of an
  38. error-checker I found a working procedure, that I'll share with you..
  39.  
  40. I had a bunch of procedures which i needed seperate error-catches for, so I
  41. made the folowing up:
  42.  
  43. Procedure _SAVE
  44.   On Error Goto S_ERR            (Enabels the errorcatch)
  45.  
  46.   blah..
  47.   blah..
  48.   blah..
  49. S_END:
  50.   On Error                       (Disabels the errorcatch)
  51.   'Clean up after the procedure'
  52.   Pop Proc
  53.  
  54. S_ERR
  55.   _SHOW_ERROR[Err$(Errn)]
  56.   Resume S_END
  57. End Proc
  58.  
  59. This way the error-catcher is only active in the one procedure, this opens for
  60. a nicer way of handeling errors, as the procedure function is simply canceled
  61. in case of an error, also a more acurate description for the user is posible,
  62. as it's clear where the error was..
  63.  
  64. Alternatives:
  65.  Using 'Resume' would make a retry at the command causing the error
  66.  (nice for disc-errors)
  67.  Using 'Resume Next' would jump to the command after the one that caused 
  68.  the error..
  69.  
  70. Notes:
  71.  NOT all errors can be caught, error-codes 1->10 is so severe that they'll
  72. allways stop the program with an error-message (Most of them are in fact
  73. error-handeling-errors :-)
  74.  To test your error-routine simply put 'Error nr' and replace 'nr' with a
  75. number higher than 10 to provoke an error in your program...
  76.  'Trap' outrankes the 'On Error' meaning if you use trap at a single command
  77. and it fails, then your error-catcher won't be activated
  78.  
  79.  
  80. If you want the SAME error-routine for your entire program then something like
  81. this would be a nice way:
  82.  
  83. On Error Proc _ERROR_CATCH
  84. blah..
  85. blah..
  86. blah..
  87. On Error
  88. End
  89.  
  90. Procedure _ERROR_CATCH
  91.   (Somehow shows the error)
  92.   If RETRY : Resume
  93.   Else : Resume Next
  94.   Endif
  95. Pop Proc
  96.  
  97.  
  98. Hope it helps, else write me back and tell more about your problem, and what
  99. you want to do...
  100.  
  101. -- 
  102. Happy greetings, Yours..
  103. __________________________________________________________________________
  104.  /_  __/ __  / __  /\  ___\  __ \__  _\           aka. JENS VANG PETERSEN
  105.   / / / /_/ / ____/  \ \___\  __ \ \ \  Nyvej 8, DK-4450 Jyderup, Denmark
  106.  /_/ /_____/_/        \_____\_\ \_\ \_\             top_cat@post8.tele.dk
  107. --------------------------------------------------------------------------
  108.  God is real, unless declared integer.
  109. --------------------------------------------------------------------------
  110.